﻿

using Framework.EncryptionDecryptionService.Enums;
using Framework.EncryptionDecryptionService.Models;

namespace Framework.EncryptionDecryptionService.Inteface
{
    /// <summary>
    /// 解密服务
    /// </summary>
    public interface IDecryptionService
    {
        /// <summary>
        /// 解密
        /// </summary>
        /// <typeparam name="T">解密后对象类型</typeparam>
        /// <param name="ciphertext">待解密字符串</param>
        /// <returns>解密后对象</returns>
        public T Decrypt<T>(string ciphertext);

        /// <summary>
        /// 解密
        /// </summary>
        /// <typeparam name="T">解密后对象类型</typeparam>
        /// <param name="encryptedBytes">待解密byte数组</param>
        /// <returns>解密后对象</returns>
        public T Decrypt<T>(byte[] encryptedBytes);

        /// <summary>
        /// 解密
        /// </summary>
        /// <param name="ciphertext">待解密字符串</param>
        /// <returns>解密后字符串</returns>
        public string Decrypt(string ciphertext);

        /// <summary>
        /// 解密
        /// </summary>
        /// <param name="encryptedBytes">待解密byte数组</param>
        /// <returns>解密后byte数组</returns>
        public byte[] Decrypt(byte[] encryptedBytes);

        /// <summary>
        /// 解密
        /// </summary>
        /// <param name="encryptedBytes">待解密byte数组</param>
        /// <returns>解密后字符串</returns>
        public string DecryptToString(byte[] encryptedBytes);

        /// <summary>
        /// 获取秘钥
        /// </summary>
        public SecretKeyModel GetSecretKey {  get; }
    }
}
